using namespace std;

#include <iostream>
#include <fstream>
#include "Graph.h"
#include "Solver.h"


inline void usage() {
    cout << "Graph cut with minimal weight" << endl;
    cout << "Usage: par-mhr <filename>" << endl;
}

/*
 * 
 */
int main(int argc, char** argv) {

     // no src file appended
    if(argc < 2) {
        usage();
        return 1;
    }

    // nonexistent src file
    fstream inFile;
    inFile.open(argv[1]);
    if (!inFile || inFile.eof()) {
        cerr << "Empty or no file" << endl;
        return 1;
    }

    // read data from src file, assign some weight to all edges
    Graph graph;
    inFile >> graph;

    // create solver, start solving
    Solver solver;
    solver.init(&graph);
    cout << graph;
    solver.solve();
    cout << solver.getBestSolution();

    return 0;
}

